
<?php include_once 'common/header.php'; ?>
<!-- admin_main -->
<div class="admin_main">
    <!-- Admin_top end -->
    <?php include_once 'common/borrow_left.php'; ?>
    <!-- Admin_Left End -->
    <div class="admin_right">
        <div class="admin_right_title">
            <strong>贷款管理</strong> &gt;&gt;  债权转让审核
        </div>

        <div class="admin_borrow">
            <form id="creditorForm" name="creditorForm">
                <?php
                $statusArr = array(
                    0 => '所有',
                    1 => '未审核',
                    2 => '审核通过',
                    3 => '已完成',
                    4 => '已取消',
                );
                ?>
                <input type="hidden" id="id" name="id" value="<?php echo $obj['id']; ?>" />
                <div class="admin_right_info_title"><h2>债权转让审核</h2></div>
                <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#CCCCCC">
                    <tr>
                        <td bgcolor="#FFFFFF">用户名：<?php echo $obj['username']; ?></td>
                        <td bgcolor="#FFFFFF">标题：<?php echo $obj['title']; ?></td>
                        <td bgcolor="#FFFFFF">待收总额：<font><?php echo number_format($obj['wait_account'], 2); ?></font></td>
                    </tr>
                    <tr>
                        <td bgcolor="#FFFFFF">投资本金：<font><?php echo number_format($obj['account'], 2); ?></font></td>
                        <td bgcolor="#FFFFFF">本金折让率：<font><?php echo $obj['discount_apr']; ?>%</font></td>
                        <td bgcolor="#FFFFFF">折后金额：<font><?php echo number_format($obj['discount_account'], 2); ?></font></td>
                    </tr>
                    <tr>
                        <td bgcolor="#FFFFFF">申请时间：<?php echo date('Y-m-d H:i:s', $obj['add_time']); ?></td>
                        <td bgcolor="#FFFFFF">状态：<font><?php echo $statusArr[$obj['fstatus']]; ?></font></td>
                        <td bgcolor="#FFFFFF">有效期：<?php echo $obj['valid_time']; ?>天</td>
                    </tr>
                    <tr>
                        <td colspan="3" bgcolor="#FFFFFF">转让说明：<br/>
                            <?php echo nl2br($obj['content']); ?>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" bgcolor="#FFFFFF">待收明细：<br/>
                            <table>
                                <tr>
                                    <td>期数</td>
                                    <td>待收时间</td>
                                    <td>待收总额</td>
                                    <td>待收本金</td>
                                    <td>待收利息</td>
                                    <td>状态</td>
                                </tr>
                                <?php
                                $cstatusArr = array(
                                    0 => '待还',
                                    1 => '已还',
                                    2 => '已取消',
                                );
                                ?>
                                <?php foreach ($coll_list as $val) { ?>
                                    <tr <?php if ($val['fstatus'] == 0) { ?> style="color:red;" <?php } else { ?> style="color:green;" <?php } ?>>
                                        <td><?php echo $val['forder'] + 1; ?></td>
                                        <td><?php echo date('Y-m-d', $val['repay_time']); ?></td>
                                        <td><?php echo $val['repay_account']; ?></td>
                                        <td><?php echo $val['capital']; ?></td>
                                        <td><?php echo $val['interest']; ?></td>
                                        <td><?php echo $cstatusArr[$val['fstatus']]; ?></td>
                                    </tr>
                                <?php } ?>

                            </table>

                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" bgcolor="#FFFFFF">状态：<input type="radio" name="fstatus" id="fstatus" value="2" checked="checked" />审核通过 <input type="radio" name="fstatus" id="fstatus" value="4" />审核不通过 </td>
                    </tr>
                    <tr>
                        <td colspan="3" bgcolor="#FFFFFF">备注：<textarea name="verify_remark"></textarea> * 若审核不通过务必写明原因</td>
                    </tr>
                </table>
                <div style="overflow:hidden;width:99%;margin:10px 0;text-align:center;"><input type="button" onclick="creditor_submit();" value="提交" class="positive" />	</div>
            </form>			
        </div>

        <!-- Admin_Right End -->
    </div>
    <!-- admin_main end -->
    <script type="text/javascript">
        function creditor_submit() {
            var options = {
                url: '/ychadmin/creditor/doverify.html',
                dataType: "text",
                type: "post",
                success: function (msg) {
                    $('#dialog').dialog({
                        modal: true,
                        title: '系统提示',
                        buttons: {"确定": function () {
                                $(this).dialog("close");
                            }},
                        close: function () {
                            location = '/ychadmin/creditor/verify_list';
                        }
                    });
                    $("#msg").html(msg);
                }
            };
            $("#creditorForm").ajaxSubmit(options);
            return false;
        }
    </script>
    <div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
